home *** CD-ROM | disk | FTP | other *** search
/ Aircraft Imagery / Aircraft Imagery.iso / autorun / vv1.~pa < prev    next >
Text File  |  1996-03-13  |  4KB  |  154 lines

  1. unit Vv1;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, FileCtrl, StdCtrls, Buttons, ExtCtrls, MPlayer,prdi,
  8.   MyRotate;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Image1: TImage;
  13.     BitBtn1: TBitBtn;
  14.     BitBtn2: TBitBtn;
  15.     Timer1: TTimer;
  16.     MediaPlayer1: TMediaPlayer;
  17.     Bevel1: TBevel;
  18.     BitBtn3: TBitBtn;
  19.     DirectoryListBox1: TDirectoryListBox;
  20.     BitBtn4: TBitBtn;
  21.     Label1: TLabel;
  22.     BitBtn6: TBitBtn;
  23.     FileListBox1: TFileListBox;
  24.     Button1: TButton;
  25.     procedure BitBtn1Click(Sender: TObject);
  26.     procedure FormCreate(Sender: TObject);
  27.     procedure BitBtn2Click(Sender: TObject);
  28.     procedure Timer1Timer(Sender: TObject);
  29.     procedure BitBtn3Click(Sender: TObject);
  30.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  31.     procedure DirectoryListBox1Change(Sender: TObject);
  32.     procedure FileListBox1DblClick(Sender: TObject);
  33.     procedure Button1Click(Sender: TObject);
  34.     procedure BitBtn6Click(Sender: TObject);
  35.     procedure BitBtn4Click(Sender: TObject);
  36.   private
  37.     { Private declarations }
  38.   public
  39.     { Public declarations }
  40.   end;
  41.  
  42. var
  43.   Form1: TForm1;
  44.   st,go:Boolean;
  45.   star:Integer;
  46. implementation
  47.  
  48. {$R *.DFM}
  49.  
  50. procedure TForm1.BitBtn1Click(Sender: TObject);
  51. begin
  52. Close;
  53. end;
  54.  
  55. procedure TForm1.FormCreate(Sender: TObject);
  56. begin
  57.      with mediaplayer1 do
  58.      begin
  59.      filename:='\autorun\v3.wav';
  60.      open;
  61.      end;
  62.      st:=True;
  63.      star:=0;
  64.      go:=false;
  65. end;
  66.  
  67. procedure TForm1.BitBtn2Click(Sender: TObject);
  68. begin
  69.      if bitbtn2.caption='Music On' then
  70.      begin
  71.         mediaplayer1.stop;
  72.         st:=False;
  73.         bitbtn2.caption:='Music Off';
  74.      End
  75.      else
  76.      begin
  77.         mediaplayer1.play;
  78.         st:=True;
  79.         bitbtn2.caption:='Music On';
  80.      End;
  81. end;
  82.  
  83. procedure TForm1.Timer1Timer(Sender: TObject);
  84. begin
  85.      if st then mediaplayer1.play
  86.      else mediaplayer1.stop;
  87. end;
  88.  
  89. procedure TForm1.BitBtn3Click(Sender: TObject);
  90. var
  91.    f:Textfile;
  92.    i:integer;
  93. begin
  94.      assignfile(f,'c:\temp.ben');
  95.      rewrite(f);
  96.      tag:=1;
  97.      for i:=0 to filelistbox1.items.count-1 do
  98.      writeln(f,filelistbox1.items[i]);
  99.      closefile(f);
  100.      priDial.show;
  101. end;
  102.  
  103. procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  104. begin
  105.      if tag=1 then
  106.      Deletefile('c:\temp.ben');
  107. end;
  108.  
  109. procedure TForm1.DirectoryListBox1Change(Sender: TObject);
  110. begin
  111.      FileListBox1.Directory:=DirectoryListBox1.Directory;
  112. end;
  113.  
  114. procedure TForm1.FileListBox1DblClick(Sender: TObject);
  115. var
  116.  I,L:Integer;
  117.  s,S2:String;
  118.  cmd:array[0..255] of char;
  119. begin
  120.      for I:=0 to FileListBox1.Items.count-1 do
  121.      If FileListBox1.Selected[I] then
  122.      Begin
  123.           S:=fileListBox1.items[I];
  124.           L:=Length(s);
  125.           s2:=s[L-2]+s[L-1]+s[L];
  126.           If (s2='bmp') or (s2='pcx') or (s2='gif') then
  127.           begin
  128.           caption:='You choosed '+s2+' file';
  129.           StrPcopy(cmd,'\vpic\vpic '+directorylistbox1.directory+'\'+s);
  130.           Winexec(cmd,SW_ShowMaximized)
  131.           end
  132.           else
  133.           caption:='This is the invalid file';
  134.      End;
  135. end;
  136.  
  137. procedure TForm1.Button1Click(Sender: TObject);
  138. begin
  139. WinExec('Winfile',SW_ShowMaximized);
  140. end;
  141.  
  142. procedure TForm1.BitBtn6Click(Sender: TObject);
  143. begin
  144.      chdir(directorylistbox1.directory);
  145.      WinExec('\vpic\vpic',SW_ShowMaximized);
  146. end;
  147.  
  148. procedure TForm1.BitBtn4Click(Sender: TObject);
  149. begin
  150.      winexec('\ployvie\polyview',SW_ShowMaximized);
  151. end;
  152.  
  153. end.
  154.